<template>
    <div class="fullScreen">
        <m-header :msg="'会员管理'"></m-header>
        <div class="he-fv bg-c-wh tx-s-14 tx-c-222">
            <div class="flex-box bg-c-wh padd-bt">
                <div class="flex-box flex-pc wd-50 bor-r-g">
                    <div class="iconSize-125 hygl_jrsy"></div>
                    <div class="mar-t-25 mar-l tx-c-r">今日收益：{{ data.todayInso }}</div>
                </div>
                <div class="line"></div>
                <div class="flex-box flex-pc wd-50">
                    <div class="iconSize-125 hygl_ljsy"></div>
                    <div class="mar-t-25 mar-l">累计收益：{{ data.allInso }}</div>
                </div>
            </div> 
            <div class="flex-box flex-pj line-box bor-b-g mar-t-5" @click="openNext('/vipManage')"> 
                <div>下级会员管理</div>
                <div class="arrow_right mar-l"></div>
            </div>
            <div class="flex-box flex-pj line-box bor-b-g" @click="openNext('/vipRecord')"> 
                <div>会员购彩记录</div>
                <div class="arrow_right mar-l"></div>
            </div> 
            <div class="flex-box flex-pj line-box bor-b-g">我的赔率：{{ data.pl }}</div>
            <div class="flex-box flex-pj line-box bor-b-g" @click="openNext('/vipInvite')">
                <div>邀请</div>
                <div class="arrow_right mar-l"></div>
            </div>
        </div>
    </div>
</template>
<script type="text/ecmascript-6">
import 'common/css/user.css'
import MHeader from '../../components/m-header'
import { isEmptyObject } from '../../common/js/common'
import { lowerIncome } from '../../common/js/axiosUtil' 
export default { 
    data() {
        return { 
            data : {
                allInso: '', todayInso: '', pl: ''
            }
        }
    },
    created() {
        this.getLowerIncome()
    },
    methods: {
        openNext (page) {
            // this.$router.push( page ) 
        },
        getLowerIncome(){ 
            let params = new URLSearchParams()
            const token = this.$token()
            params.append('timeStamp', token[0])
            params.append('token', token[1])
            params.append('uid', this.$store.state.bfUserInfo.uid)
            lowerIncome(params)
            .then((response)=> { 
                // 隐藏下拉刷新状态;
                // this.mescroll.endErr()  
                if(response.data.code == "200"){
                    this.data = response.data.data
                    if(isEmptyObject(this.data)){ 
                    }else{
                        this.$toast("数据加载失败", 2000)
                    }
                } else {
                    this.$logAgain(response.data.msg)
                }
            })
            .catch((error)=> {
                // 联网失败的回调,隐藏下拉刷新和上拉加载的状态;
                // this.mescroll.endErr()
                this.$toast('请求服务失败', 2000)
            });
        }
    },
    components: {
        MHeader
    }
}
</script>
<style scoped lang="stylus" rel="stylesheet/stylus"> 
    .line-box
        padding: 1rem
        background: white
    .padd-bt
        padding : 1.5rem 0
    .mar-l
        margin-left: .75rem
    .hygl_jrsy
        background-image : url('../../common/image/hygl_jrsy.png')
    .hygl_ljsy
        background-image : url('../../common/image/hygl_ljsy.png')
</style>

